您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

[...nextauth].ts 425B

1234567891011121314151617
  1. import NextAuth from 'next-auth'
  2. import Providers from 'next-auth/providers'
  3. import { redirect } from 'next/dist/next-server/server/api-utils'
  4. export default NextAuth({
  5. providers: [
  6. Providers.GitHub({
  7. clientId: process.env.GITHUB_ID,
  8. clientSecret: process.env.GITHUB_SECRET,
  9. }),
  10. ],
  11. callbacks: {
  12. async redirect(url, baseUrl) {
  13. return url.startsWith(baseUrl) ? url : baseUrl
  14. },
  15. },
  16. })